/**
 * Copyright (C) 2012 LightAsyncHttpClient Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.lurencun.android.topicbank.http;

import org.apache.http.HttpResponse;

/**
 * <ul>
 * <li><b>name : </b>		RequestHandler		</li>
 * <li><b>description :</b>	处理服务端响应的接口				</li>
 * <li><b>author : </b>		桥下一粒砂			</li>
 * <li><b>e-mail : </b>		chenyoca@gmail.com	</li>
 * <li><b>weibo : </b>		@桥下一粒砂			</li>
 * <li><b>date : </b>		2012-9-22 上午1:22:35		</li>
 * </ul>
 */
public interface ResponseCallback {

	/**
	 * 在发起连接时回调
	 */
	void onStart(String url);
	
	/**
	 * 连接成功后回调
	 * @param requestId 
	 * @param response
	 */
	void onSuccess(int requestId, HttpResponse response,String url);
	
	/**
	 * 线程被取消中断时回调
	 */
	void onCancel(int requestId,String url);
	
	/**
	 * 在发生异常时回调
	 * @param error
	 * @param requestId 
	 */
	void onError(Throwable error,int requestId, String url);
}
